<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<div class="table-responsive">
<form class="form-inline" method="GET" action="<?php echo $this->input->server('REQUEST_URI'); ?>" name="queryForm" id="queryForm">
<input type="hidden" name="subType" id="subType" value="query">
<input type="hidden" name="c" id="c" value="Main">
<input type="hidden" name="m" id="m" value="adminTotal">
  <div class="form-group">
    <label for="year">所属年份：</label>
    <select class="form-control" id="year" name="year">
	  <?php foreach ($yearList as $key => $value) {?>
	  <option value="<?=$key?>" <?=$year==$key ? 'selected="selected"' : ''?>><?php echo $value ?></option>
      <?php } ?>
	</select>
  </div>
  <div class="form-group">
    <label for="timeUnit">所属双月：</label>
    <select class="form-control" id="timeUnit" name="timeUnit">
      <?php foreach ($timeUnitList as $key => $value) {?>
	  <option value="<?=$key?>" <?=$timeUnit==$key ? 'selected="selected"' : ''?>><?php echo $value ?></option>
      <?php } ?>
	</select>
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">基金类型：</label>
    <select class="form-control" id="fundType" name="fundType">
      <option value="">请选择</option>
	    <option value="1" <?=$fundType==1 ? 'selected="selected"' : ''?>>百县强基</option>
	</select>
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">显示类型：</label>
    <select class="form-control" id="showType" name="showType">
	  <option value="1" <?=$showType==1 ? 'selected="selected"' : ''?>>全部显示</option>
	  <option value="2" <?=$showType==2 ? 'selected="selected"' : ''?>>仅大区</option>
	</select>
  </div>
  <div class="form-group">
  <button type="button" class="btn btn-default btn-primary" onclick="queryFrom()">查询</button>
  <button type="button" class="btn btn-default btn-primary" onclick="exportExcel()">导出</button>
	</div>
</form>
	</div>
<div style="margin-top: 10px;">
  <?php
  if ($showType == 1) {//小区形式
  	$this->load->view('Main/part/singleSpsareaTable', $this->viewData);
  }elseif($showType == 2){//大区形式
	  $this->load->view('Main/part/singleRegionTable', $this->viewData);
  }
  ?>
</div>
<script type="text/javascript">
  $(function(){
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
    $("#year").change(function(){
      loadTimeUnitList('timeUnit',this.value);
    });
  });
  function queryFrom(){
    $('#subType').val('query');
    $("#queryForm").submit();
  }
  function exportExcel(){
    $('#subType').val('export');
    $("#queryForm").submit();
  }
</script>
<?php $this->load->view('common/foot');?>